from typing import Type

from .base import ExchangePublicServiceBase, ExchangePriServiceBase
from .contants import Exchange
from .deribit import DeribitPublicService, DeribitPriService
from .binance import BinancePublicService, BinancePriService


def get_exchange_pub_service_cls(exchange) -> Type[ExchangePublicServiceBase]:
    if exchange == Exchange.BINANCE:
        return BinancePublicService
    if exchange == Exchange.DERIBIT:
        return DeribitPublicService
    raise ValueError(f'exchange {exchange} has no pub service implement.')


def get_exchange_pri_service_cls(exchange) -> Type[ExchangePriServiceBase]:
    if exchange == Exchange.BINANCE:
        return BinancePriService
    if exchange == Exchange.DERIBIT:
        return DeribitPriService
    raise ValueError(f'exchange {exchange} has no pri service implement.')
